]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
switcherPopup: Add a return value to _keyPressHandler
authorRui Matos <tiagomatos@gmail.com>
Mon, 26 May 2014 13:27:16 +0000 (15:27 +0200)
committerRui Matos <tiagomatos@gmail.com>
Mon, 26 May 2014 13:55:37 +0000 (15:55 +0200)
This allows us to handle keybindings that use Escape instead of just
dismissing the popup unconditionally when we see an Escape press.

https://bugzilla.gnome.org/show_bug.cgi?id=730739

js/ui/altTab.js
js/ui/ctrlAltTab.js
js/ui/status/keyboard.js
js/ui/switcherPopup.js

index 40fae87c22d39c4c400b88dfb91dd1cc81c1a6d3..78773d931c3c696f41a4b9c725e58897126645c8 100644 (file)
@@ -167,6 +167,8 @@ const AppSwitcherPopup = new Lang.Class({
                 this._select(this._selectedIndex, this._nextWindow());
             else if (keysym == Clutter.Up)
                 this._select(this._selectedIndex, null, true);
+            else
+                return Clutter.EVENT_PROPAGATE;
         } else {
             if (keysym == Clutter.Left)
                 this._select(this._previous());
@@ -174,7 +176,11 @@ const AppSwitcherPopup = new Lang.Class({
                 this._select(this._next());
             else if (keysym == Clutter.Down)
                 this._select(this._selectedIndex, 0);
+            else
+                return Clutter.EVENT_PROPAGATE;
         }
+
+        return Clutter.EVENT_STOP;
     },
 
     _scrollHandler: function(direction) {
@@ -404,7 +410,11 @@ const WindowSwitcherPopup = new Lang.Class({
                 this._select(this._previous());
             else if (keysym == Clutter.Right)
                 this._select(this._next());
+            else
+                return Clutter.EVENT_PROPAGATE;
         }
+
+        return Clutter.EVENT_STOP;
     },
 
     _finish: function() {
index e5229090521ebea70ee6c441d224d2880a135865..19911970737c4fc21c91bff114c04672d74b5e2d 100644 (file)
@@ -165,6 +165,10 @@ const CtrlAltTabPopup = new Lang.Class({
             this._select(this._previous());
         else if (keysym == Clutter.Right)
             this._select(this._next());
+        else
+            return Clutter.EVENT_PROPAGATE;
+
+        return Clutter.EVENT_STOP;
     },
 
     _finish : function(time) {
index 8d6242da253893f3f82c5731db41785c68cc0cf0..0df05027c997641e28a6ec1075b5e50adc2150b1 100644 (file)
@@ -292,6 +292,10 @@ const InputSourcePopup = new Lang.Class({
             this._select(this._previous());
         else if (keysym == Clutter.Right)
             this._select(this._next());
+        else
+            return Clutter.EVENT_PROPAGATE;
+
+        return Clutter.EVENT_STOP;
     },
 
     _finish : function() {
index f7b8897e8f67eda8108403c0aeda1de1b33e0879..64df5fe541140f58c9f2ddb779232015eadcd507 100644 (file)
@@ -190,10 +190,11 @@ const SwitcherPopup = new Lang.Class({
 
         this._disableHover();
 
+        if (this._keyPressHandler(keysym, backwards, action) != Clutter.EVENT_PROPAGATE)
+            return Clutter.EVENT_STOP;
+
         if (keysym == Clutter.Escape)
             this.destroy();
-        else
-            this._keyPressHandler(keysym, backwards, action);
 
         return Clutter.EVENT_STOP;
     },